package service.impl;

import bean.pojo.Room;
import dao.RoomDao;
import dao.impl.RoomDaoImpl;
import service.RoomService;

import java.util.List;

/**
 * service.impl
 * User: 坚持
 * Date: 2024/12/17 11:45
 * motto: 树欲静而风不止
 * Description:
 * Version: V1.0
 */
public class RoomServiceImpl implements RoomService {
    RoomDao roomDao = new RoomDaoImpl();

    /**
     * 修改房产信息
     * @param room
     * @return
     */
    @Override
    public Boolean update(Room room) {return roomDao.update(room)>0;}

    @Override
    public Boolean add(Room room) {return roomDao.add(room)>0;}

    @Override
    public List<Room> roomFindBy(Integer page, Integer limit, Integer roomId, String roomNumber, String roomType, Integer roomArea, String remarks, Integer userId) {
       return roomDao.roomFindBy( page,  limit,  roomId,  roomNumber,  roomType,  roomArea,  remarks,  userId);
    }

    @Override
    public Long findByTotal(Integer roomId, String roomNumber, String roomType, Integer roomArea, String remarks, Integer userId) {
        return roomDao.findByTotal(roomId,  roomNumber,  roomType,  roomArea,  remarks,  userId);
    }

    @Override
    public Boolean deleteById(Integer roomId) {
        return roomDao.deleteById(roomId)>0;
    }

    @Override
    public List<Room> findType() {
       return roomDao.findType();
    }

    @Override
    public List<Room> findRoomList() {
        return roomDao.findRoomList();
    }


}
